//////////////////////////////////////////////////////////////////////////////////
//	Copyright 2011 by Yosef Grabivker, ryuho@homenetworksoft.com
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//////////////////////////////////////////////////////////////////////////////////

#ifndef __RT_EVENTS_YG_H__
#define __RT_EVENTS_YG_H__

#include "def.h"

BEGIN_DECLARE_EVENT_TYPES()
    DECLARE_EVENT_TYPE(wxEVT_THREAD_EXIT,  		MESSAGE_ID_START+2)
    DECLARE_EVENT_TYPE(wxEVT_ON_ROUTER_THREAD,	MESSAGE_ID_START+3)
	DECLARE_EVENT_TYPE(wxEVT_ON_SYSLOGMSG,		MESSAGE_ID_START+4)
	DECLARE_EVENT_TYPE(wxEVT_REG_CHECK,			MESSAGE_ID_START+5)
	DECLARE_EVENT_TYPE(wxEVT_PING,				MESSAGE_ID_START+6)
END_DECLARE_EVENT_TYPES()


#define EVT_ON_THREAD_EXIT(id, fn) \
    DECLARE_EVENT_TABLE_ENTRY( \
    	wxEVT_THREAD_EXIT, id, wxID_ANY, \
        (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
        (wxObject *) NULL \
    ),


#define EVT_ON_ROUTER_THREAD(id, fn) \
    DECLARE_EVENT_TABLE_ENTRY( \
    		wxEVT_ON_ROUTER_THREAD, id, wxID_ANY, \
    		(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
    		(wxObject *) NULL \
    ),

#define EVT_ON_SYSLOGMSG(id, fn) \
	DECLARE_EVENT_TABLE_ENTRY( \
	wxEVT_ON_SYSLOGMSG, id, wxID_ANY, \
	(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
	(wxObject *) NULL \
	),

#define EVT_ON_REGCHECK(id, fn) \
	DECLARE_EVENT_TABLE_ENTRY( \
	wxEVT_REG_CHECK, id, wxID_ANY, \
	(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
	(wxObject *) NULL \
	),

#define EVT_ON_PING(id, fn) \
	DECLARE_EVENT_TABLE_ENTRY( \
	wxEVT_PING, id, wxID_ANY, \
	(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
	(wxObject *) NULL \
	),

#endif //__RT_EVENTS_YG_H__